'use strict';{let v={},t={};var _py=function(d,b,c){let f=c.group||"0";t[f]=t[f]||0;let g=_ih(v,f,[]);g.push([d,b,c]);1==g.length&&_nd(function*(){for(;g[0];){let [e,n,l]=g[0],u=l.inputSeq||[];if("stop"==(l.intoPage?yield E(u,l.times,l.keepModKeys,f,e):yield y(u,l.times,l.keepModKeys,f)))break;g.shift();"group"!=l.queue&&n(e)}});"group"==c.queue&&b(d)},_rd=function(d,b,c){if(c.group){var f=c.group;t[f]=Date.now();v[f]=[]}else for(f in v)c=f,t[c]=Date.now(),v[c]=[];b(d)};let F=function(d,b,c,f){d=
d==_C?f:d==_uo?_h.desktop:_ti(_h[_Oh(f)].bounds);return{x:"M"==b?d.x+Math.round(d.w/2):"E"==b?d.x+d.w:d.x,y:"M"==c?d.y+Math.round(d.h/2):"E"==c?d.y+d.h:d.y}},z,A=function(d){clearTimeout(z);d?_So(_kf,!0):z=setTimeout(()=>_So(_kf,!1),50)},E=(d,b,c,f,g)=>e=>{let n=new _do;for(let l of _Nd(g))0<l&&y(d,b,c,f,l)(n.onReady());n.setCallback(e)},y=_wj(function*(d,b=1,c,f,g){let e=[],n=Date.now();if(g){_Ky.tabs.executeScript(g,{code:B+"",allFrames:!0,matchAboutBlank:!0},_fy);var l=g==_Ca&&_Kg(_os[g],"window",
"focused")}let u=_wj(function*(a){if(e.length&&n>=t[f]){if(g)for(let h of e)G(g,h);else{if(a&&(a=e[e.length-1],a[0]==_ij&&a[3]))var k=e.pop();yield _fw(_Ld,e)}e=k?[k]:[]}}),w=_wj(function*(a){yield u();n>=t[f]&&(yield _Pi(1E3*(a||0)))}),H=_wj(function*(a){let k={};if(a.dX||a.dY||a.wrtObj){var h=a.keyId==_ij;let m=a.wrtObj==_W,p=e[e.length-1],q=p&&p[0]==_ij;m&&q||h&&a.wrtObj==_uo&&!a.anim||(yield u(!0),k=yield _fw(_zw,a.wrtObj|_8s));q&&(k.mouse={x:p[1],y:p[2]});h=m?k.mouse.sc():F(a.wrtObj,a.wrtHorz,
a.wrtVert,k.win);h.x+=a.dX||0;h.y+=a.dY||0}return[k.mouse,h]}),I=_wj(function*(a,k,h,m){var p=_qs(a,k);let q=Math.max(1,Math.round(36*h));q=Math.max(1,Math.ceil(p/Math.max(1,p/q)));p=(k.x-a.x)/q;k=(k.y-a.y)/q;m&&A(!0);for(let C=0;C<q-1;++C)a.x+=p,a.y+=k,x(Math.round(a.x),Math.round(a.y)),yield w(h/q);m&&A(!1)}),x=(a,k,h)=>{let m=e[e.length-1];m&&m[0]==_ij&&m[3]?(m[1]=a,m[2]=k,m[3]=h):e.push([_ij,a,k,h])};if((!g||l)&&!c)var D=yield _fw(_Oy,{state:!0});for(c=0;c<b;++c)for(let a of d)for(l=0;l<(a.repeat||
1);++l){if(a.keyId==_Ny)yield w(a.hold);else{let [k,h]=yield H(a);h&&(a.anim&&(yield I(k,h,a.anim,!a.noMovBlk)),x(h.x,h.y));a.keyId!=_ij&&(e.push(a.keyId|("U"==a.action?_Go:_Ku)),a.hold&&(yield w(a.hold)),"DU"==a.action&&e.push(a.keyId|_Go),h&&x(k.x,k.y,!0))}if(n<t[f])return"stop"}yield u();D&&_So(_Oy,{keys:D,state:!1})}),G=function(d,b){if("number"==typeof b&&(b=_3j(b,!0),b.devId==_ps)){let c=b.num&~_au;const f=b.num&_au,g=_Kg(_Ci,b.num,1),e=g>_Lg&&(!f&&!(48<=b.num&&57>=b.num)||b.num==(_Mj|_au)),
n=0<g&&g<_Lg;n&&(c=g);_Ky.tabs.executeScript(d,{allFrames:!0,matchAboutBlank:!0,code:`\n ${B.name}( ${c}, ${b.type==_Ku}, ${n?f?2:1:e?3:0} )\n `},_fy);return!0}},r,B=function g(b,c,f){if(g){"undefined"==typeof r&&(r=[]);var e=r.indexOf(b);c&&-1==e&&r.push(b);!c&&0<=e&&r.splice(e,1);document.activeElement.dispatchEvent(new KeyboardEvent(c?"keydown":"keyup",{bubbles:!0,cancelable:!0,keyCode:b,which:b,location:f,repeat:c&&0<=e,shiftKey:0<=r.indexOf(16),ctrlKey:0<=r.indexOf(17),altKey:0<=r.indexOf(18)}))}}};
